package org.opensource.extfaces.functions;

import java.util.Map;

public class CommunicateLayerFunction {
	public static String generateForm(java.util.List<Map> fields,java.util.List<Map> buttons,Map bindingMap){
		StringBuilder builder=new StringBuilder();
		builder.append("<h:panelGroup id=\"#{formConfig.id}\" style=\"display:none\">");
		for(int i=0;i<fields.size();i++){
			Map map=(Map)fields.get(i);
			String name=(String)map.get("name");
			String bindingString=(String)bindingMap.get(name);
			builder.append("<input jsfc=\"h:inputHidden\" value=\""+bindingString+"\" type=\"hidden\"/>");
		}
		builder.append("</h:panelGroup>");
		return builder.toString();
	}
}
